package chapter11;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author lzy
 * @create 2018-03-23 上午11:48
 */
public class BufferReaderTest {
    public static void main(String[] args) {
        File file = new File(File.separator + "home" + File.separator + "lzy" + File.separator + "logs" + File.separator + "test" + File.separator + "test.dat");
        try (BufferedReader reader = new BufferedReader(new FileReader(file))){
            String str = null;
            while ((str = reader.readLine()) != null) {
                System.out.println("[read line]:" + str);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
